<?php
/**
 *  💡 免责声明：本软件不得用于商业用途，仅做学习交流
 *  ⚠️ 权利声明：本软件由版权人提供产品技术支持
 *  📅 项目编号：NX2025-0135
 */
namespace App\StateMachines;

//退款状态机
use Asantibanez\LaravelEloquentStateMachines\StateMachines\StateMachine;

class RefundStatusStateMachine extends StateMachine
{
    public function recordHistory(): bool
    {
        return false;
    }

    public function transitions(): array
    {
        return [
            'draft' => ['pending'],
            'pending' => ['approved', 'rejected'],
            'approved' => ['processing'],
            'processing' => ['succeeded', 'failed'],
            'failed' => ['processing'], // 允许重试
            'succeeded' => [],
            'rejected' => [],
        ];
    }

    public function defaultState(): string
    {
        return 'draft';
    }
}
